/*****************************************************************************
 *   i2ctest.c:  main C entry file for NXP LPC13xx Family Microprocessors
 *
 *   Copyright(C) 2008, NXP Semiconductor
 *   All rights reserved.
 *
 *   History
 *   2008.07.20  ver 1.00    Preliminary version, first Release
 *
******************************************************************************/


#include "LPC13xx.h"			/* LPC13xx Peripheral Registers */
//
//#include "../config/type.h"
//#include "misc.h"
//#include "../driver/i2c.h"
//#include "i2c_peripherals.h"
//#include "spi_peripherals.h"
//#include "pwm.h"

#define PCA9632_ADDRESS           0xa4   // b'1100-010(RW)
#define PCA9632_ADDRESS_allCall   0xE0   //
#define PCA9632_ADDRESS_SWRST     0x06   //


/*******************************************************************************
**   Main Function  main()
*******************************************************************************/
int main (void)
{
	  /* Basic chip initialization is taken care of in SystemInit() called
	   * from the startup code. SystemInit() and chip settings are defined
	   * in the CMSIS system_<part family>.c file.
	   */


//   DS1307Error_t DS1307_error;
//   TSL2550Error_t TSL2550_error;
//   spi_Error_t AS1107_error;



//   uint32_t lux;
//   uint8_t lux_8;

//  if ( I2CInit( (uint32_t)I2CMASTER ) == FALSE )	/* initialize I2c */
//  {
//	while ( 1 );				/* Fatal error */
//  }

//  AS1107_error = DisplayInit();
//
//  TSL2550_error = TSL2550_init();
//  DS1307_error = DS1307Init();
  //DS1307_error = DS1307SetTime(0, 7, 13, 05, 12, 21, 02, 30);

//  RTC_time_t time;
//  uint8_t broadband, ir;
//  TSL2550Error_t error = TSL2550_ERROR_OK;


  while (1)
  {

//      I2CWriteLength = 2;
//      I2CReadLength = 4;
//      I2CMasterBuffer[0] = PCA9632_ADDRESS;
//      I2CMasterBuffer[1] = 0xe0;            /* start from register 0, autoincrement */
//      I2CMasterBuffer[2] = PCA9632_ADDRESS | RD_BIT;


//	  error = TSL2550GetLum(&broadband, &ir);
//
//	  lux = TSL2550GetLux();
//	  DS1307_error = DS1307GetTime(&time);
//	      printf("DW:%d, %d-%d-20%d, %d:%d:%d, lux: %d, lux_8: %d \r",
//	    		  time.dayofweek, time.day, time.month, time.year,
//	    		  time.hour, time.minute, time.second, lux, lux_8);


  }


  return 0;
}

/******************************************************************************
**                            End Of File
******************************************************************************/
